﻿using HttpClientWeappers;
using Newtonsoft.Json;
using System.ComponentModel.Design;

namespace T.Materials.API.MaterialsServer
{
    public class HttpPosts
    {
        public async Task<dynamic> CreatePost()
        {
            string token = "";
            HttpClientWrapper client = new HttpClientWrapper(token);
            string url = "http://localhost:5125/api/MaterialRequisition/AddMaterialStore";
            var requestBody = new
            {
                CompanyID = "1",
                User_Id = "1",
                Titlte = "1",
                UsageDescription = "1",
                Recipient = "",
                MaterialRequisitNotes = "1",
                CollectionDate = "2024-11-19T02:06:51.933Z",
                ApprovalStatus = "10",
                Approver = "1",
                CreatedBy = "1",
                CreatedDate = DateTime.Now,
            };

            var jsonCount = JsonConvert.SerializeObject(requestBody); 
            string postReopnse =await client.PostAsync(url, jsonCount);
            return postReopnse;
        }
    }
}
